package zust.javaee.entity;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by liy on 2016/12/18.
 */
@Entity
@Table(name = "tannouncement")
public class Tannouncement {

    private Integer id;
    private Tcorporation tcorporation;
    private Tmember principal;
    private String title;
    private String content;
    private Date createTime;
    private Date updateTime;
    private Short type;
    private String fileUrl;
    private Integer readCount;
    private String pic;

    public Tannouncement() {
    }

    @Id
    @GeneratedValue
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "corporation_id")
    public Tcorporation getTcorporation() {
        return tcorporation;
    }

    public void setTcorporation(Tcorporation tcorporation) {
        this.tcorporation = tcorporation;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "principal_id")
    public Tmember getPrincipal() {
        return principal;
    }

    public void setPrincipal(Tmember principal) {
        this.principal = principal;
    }

    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "type")
    public Short getType() {
        return type;
    }

    public void setType(Short type) {
        this.type = type;
    }

    @Column(name = "file_url")
    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    @Column(name = "read_count")
    public Integer getReadCount() {
        return readCount;
    }

    public void setReadCount(Integer readCount) {
        this.readCount = readCount;
    }


    @Column(name = "pic")
    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }
}
